package student.aistar.day13;

import java.io.Serializable;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2021/7/26 8:44 上午
 */
public class Book implements Serializable {
    private int id;

    private String isbn;

    private String name;

    private double price;

    public Book() {
    }

    public Book(int id, String isbn, String name, double price) {
        this.id = id;
        this.isbn = isbn;
        this.name = name;
        this.price = price;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getIsbn() {
        return isbn;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Book book = (Book) o;

        return id == book.id;
    }

    @Override
    public int hashCode() {
        return id;
    }

    @Override
    public String toString() {
        return "Book{" +
                "id=" + id +
                ", isbn='" + isbn + '\'' +
                ", name='" + name + '\'' +
                ", price=" + price +
                '}';
    }
}
